package com.ccsu.mymarket.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ccsu.mymarket.entity.Authority;
import com.ccsu.mymarket.entity.OrderInfo;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface OrderInfoDao extends BaseMapper<OrderInfo> {
     List<OrderInfo> getOrderForBuyer(Integer id);

     List<OrderInfo> getOrderForSeller(List<Integer> bookIdList);


    /**
     * 批量下单
     * 还需用到 批量更新商品库存 +  更新用户余额 + 删除购物车记录
     * @param orderInfoList
     * @return
     */
    int batchAddOrder(List<OrderInfo> orderInfoList);
//    批量更新商品库存
    int batchUpdateStock(List<OrderInfo> orderInfoList);
//    更新用户余额
    int batchUpdatePurse(Integer userId,Double sum);

}
